package com.deli.service.impl;

import com.deli.entity.Admin;
import com.deli.mapper.TestBatchMapper;
import com.deli.service.TestBatchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Author: xudeli
 * @CreateDate: 2019/8/18 21:26
 **/
@Service("testBatchService")
public class TestBatchServiceImpl implements TestBatchService {

    @Autowired
    private TestBatchMapper testBatchMapper;

    @Override
    public List<Map> queryCommodity(String code) {
        List<Map> mapList = testBatchMapper.queryCommodity(code);
        return mapList;
    }

    @Override
    public int insertExemple(Map params) {
        for (int i = 0; i < 1000; i++) {
            HashMap<String, Object> map = new HashMap<>();
            map.put("id", i);
            map.put("workCode", i);
            map.put("status", i);
            testBatchMapper.insertExemple(map);
        }
        return 0;
    }

    @Override
    public List<Admin> queryBatchCommodity(List<String> code) {
        List<Admin> maps = testBatchMapper.queryBatchCommodity(code);
        return maps;
    }
}
